<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户扩展信息列表')" />
    <th:block th:include="include :: daterangepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>用户ID：</label>
                                <input type="text" name="uid"/>
                            </li>
                            <li>
                                <label>省/市：</label>
                                <input type="text" name="searchInput"/>
                            </li>
                            <li>
                                <label>手机号：</label>
                                <input type="text" name="mobile" placeholder="189****2363/18911112363"/>
                            </li>
                            <li>
                                <label>渠道编号：</label>
                                <select name="channelCode" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${channelCodeList}" th:text="${item.value}" th:value="${item.value}"></option>
                                </select>
                            </li>
                            <li>
                                <label>渠道名称：</label>
                                <select name="channelCode" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${channelCodeList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>

                            <li>
                                <label>贷款金额：</label>
                                <select name="loanAmount" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${loanAmount.itemList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>
                            <li>
                                <label>芝麻信用：</label>
                                <select name="zhimaScore" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${zhimaScore.itemList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>

                            <li>
                                <label>公积金：</label>
                                <select name="gjj" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${gjj.itemList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>

                            <li>
                                <label>房产：</label>
                                <select name="house" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${house.itemList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>

                            <li>
                                <label>车辆：</label>
                                <select name="car" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${car.itemList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>
                            <li>
                                <label>保单：</label>
                                <select name="insurance" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${baodan.itemList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>
                            <li>
                                <label>社保：</label>
                                <select name="socialInsurance" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${shebao.itemList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>
                            <li>
                                <label>用户资质：</label>
                                <select name="excellent" class="form-control">
                                    <option value="">所有</option>
                                    <option value="excellent">优质(车房公积金三选一)</option>
                                </select>
                            </li>
                            <li>
                                <label>注册时间：</label>
                                <input type="text" width="150px" id="createTime" name="createTime" autocomplete="off"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="authDataMapChart();">
                    <i class="fa fa-desktop"></i> 省份城市分布图
                </a>
                <a class="btn btn-success" onclick="city100MapChart();">
                    <i class="fa fa-desktop"></i> 城市前百分布图
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: daterangepicker-js" />
     <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('member:extInfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('member:extInfo:remove')}]];
        var prefix = ctx + "member/extInfo";
        var prefixView = ctx + "member/info/view/";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "用户扩展信息",
                striped: true,
                onLoadSuccess: function (data){
                    var unVisibleColumns = data.extData.unVisibleColumns;
                    if (unVisibleColumns != undefined && unVisibleColumns != ''){
                        for(var index = 0; index < unVisibleColumns.length; index++){
                            var columns = unVisibleColumns[index];
                            $.table.hideColumn(columns, "bootstrap-table");
                        }
                    }
                },
                columns: [
                //     {
                //     checkbox: true
                // },
                // {
                //     field: 'uid',
                //     title: '用户ID',
                //     formatter: function(value, row, index) {
                //         console.log(row)
                //         return 'uid-'+row.uid;
                //     }
                // },
                {
                    field: 'uid',
                    title: 'uid',
                    formatter: function (value,row,index){
                        var result = '<span style="color: #1c84c6; border-bottom: 1px solid" onclick="memberInfoView(\''+row.uid+'\')">'+row.uid+'</a>';
                        return result;
                    }
                },
                {
                    field: 'mobileStr',
                    title: '手机号'
                },
                {
                    field: 'username',
                    title: '姓名',
                    formatter: function (value,row,index){
                        return row.usernameStr + "-" + row.age + '-' +(row.sex == 1?"男":"女");
                    }
                },
                    {
                        field: 'startLevel',
                        title: '星级'
                    },
                    // {
                    //     field: 'age',
                    //     title: '年龄'
                    // },
                    // {
                    //     field: 'sex',
                    //     title: '性别',
                    //     formatter: function (value,row,index){
                    //         return row.sex == 1?"男":"女";
                    //     }
                    // },
                // {
                //     field: 'idCardStr',
                //     title: '身份证'
                // },
                {
                    field: 'channelName',
                    title: '渠道名称'
                },
                {
                    field: 'appName',
                    title: '应用名称'
                },
                {
                    field: 'province',
                    title: '省',
                    formatter: function (value,row,index){
                        return row.province+'-'+row.city;
                    }
                },
                // {
                //     field: 'city',
                //     title: '市'
                // },
                // {
                //     field: 'address',
                //     title: '地址'
                // },
                // {
                //     field: 'addressCode',
                //     title: ''
                // },
                {
                    field: 'yuqi',
                    title: '是否逾期'
                },
                {
                    field: 'loanAmount',
                    title: '贷款金额'
                },


                {
                    field: 'gjj',
                    title: '公积金'
                },
                // {
                //     field: 'salary',
                //     title: '薪资情况'
                // },
                {
                    field: 'house',
                    title: '房产信息'
                },
                // {
                //     field: 'job',
                //     title: '工作信息'
                // },
                {
                    field: 'car',
                    title: '车辆信息'
                },
                {
                    field: 'baodan',
                    title: '保单'
                },
                {
                    field: 'shebao',
                    title: '社保'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                }
                // ,
                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.uid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.uid + '\')"><i class="fa fa-remove"></i>删除</a>');
                //         return actions.join('');
                //     }
                // }
                ]
            };
            $.table.init(options);
        });

        $('#createTime').daterangepicker({
                "timePicker": true,
                "timePicker24Hour": true,
                "timePickerSeconds": true,
                "locale": {
                    "direction": "ltr",
                    "format": "YYYY-MM-DD HH:mm:ss",
                    "separator": " ~ ",
                    "applyLabel": "确定",
                    "cancelLabel": "取消",
                    "daysOfWeek": [ "七", "一", "二", "三", "四", "五", "六"],
                    "monthNames": ["1","2","3","4","5","6","7","8","9","10","11","12"
                    ],
                    // "firstDay": 1
                }
            },function (){}
        );

        function memberInfoView(uid){
            var url = prefixView + uid;
            $.modal.open('用户详情', url);
        }

        function authDataMapChart(){
            var url = prefix + '/chartMapProvince';
            $.modal.openTab('认证数据分布图', url);
        }
        function city100MapChart(){
            var url = prefix + '/chartMap100City';
            $.modal.openTab('城市前百分布', url);
        }
    </script>
</body>
</html>